Optimal. Leaf size=236 \[ \frac {a \left (4 a^2 B+15 a b C+12 b^2 B\right ) \tan (c+d x) \sec ^2(c+d x)}{15 d}+\frac {a^2 (5 a C+7 b B) \tan (c+d x) \sec ^3(c+d x)}{20 d}+\frac {\left (8 a^3 B+30 a^2 b C+30 a b^2 B+15 b^3 C\right ) \tan (c+d x)}{15 d}+\frac {\left (3 a^3 C+9 a^2 b B+12 a b^2 C+4 b^3 B\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {\left (3 a^3 C+9 a^2 b B+12 a b^2 C+4 b^3 B\right ) \tan (c+d x) \sec (c+d x)}{8 d}+\frac {a B \tan (c+d x) \sec ^4(c+d x) (a+b \cos (c+d x))^2}{5 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.56, antiderivative size = 236, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 9, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.225, Rules used = {3029, 2989, 3031, 3021, 2748, 3768, 3770, 3767, 8} \[ \frac {\left (30 a^2 b C+8 a^3 B+30 a b^2 B+15 b^3 C\right ) \tan (c+d x)}{15 d}+\frac {\left (9 a^2 b B+3 a^3 C+12 a b^2 C+4 b^3 B\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a \left (4 a^2 B+15 a b C+12 b^2 B\right ) \tan (c+d x) \sec ^2(c+d x)}{15 d}+\frac {\left (9 a^2 b B+3 a^3 C+12 a b^2 C+4 b^3 B\right ) \tan (c+d x) \sec (c+d x)}{8 d}+\frac {a^2 (5 a C+7 b B) \tan (c+d x) \sec ^3(c+d x)}{20 d}+\frac {a B \tan (c+d x) \sec ^4(c+d x) (a+b \cos (c+d x))^2}{5 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2748
Rule 2989
Rule 3021
Rule 3029
Rule 3031
Rule 3767
Rule 3768
Rule 3770
Rubi steps
\begin {align*} \int (a+b \cos (c+d x))^3 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^7(c+d x) \, dx &=\int (a+b \cos (c+d x))^3 (B+C \cos (c+d x)) \sec ^6(c+d x) \, dx\\ &=\frac {a B (a+b \cos (c+d x))^2 \sec ^4(c+d x) \tan (c+d x)}{5 d}+\frac {1}{5} \int (a+b \cos (c+d x)) \left (a (7 b B+5 a C)+\left (4 a^2 B+5 b^2 B+10 a b C\right ) \cos (c+d x)+b (2 a B+5 b C) \cos ^2(c+d x)\right ) \sec ^5(c+d x) \, dx\\ &=\frac {a^2 (7 b B+5 a C) \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {a B (a+b \cos (c+d x))^2 \sec ^4(c+d x) \tan (c+d x)}{5 d}-\frac {1}{20} \int \left (-4 a \left (4 a^2 B+12 b^2 B+15 a b C\right )-5 \left (9 a^2 b B+4 b^3 B+3 a^3 C+12 a b^2 C\right ) \cos (c+d x)-4 b^2 (2 a B+5 b C) \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx\\ &=\frac {a \left (4 a^2 B+12 b^2 B+15 a b C\right ) \sec ^2(c+d x) \tan (c+d x)}{15 d}+\frac {a^2 (7 b B+5 a C) \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {a B (a+b \cos (c+d x))^2 \sec ^4(c+d x) \tan (c+d x)}{5 d}-\frac {1}{60} \int \left (-15 \left (9 a^2 b B+4 b^3 B+3 a^3 C+12 a b^2 C\right )-4 \left (8 a^3 B+30 a b^2 B+30 a^2 b C+15 b^3 C\right ) \cos (c+d x)\right ) \sec ^3(c+d x) \, dx\\ &=\frac {a \left (4 a^2 B+12 b^2 B+15 a b C\right ) \sec ^2(c+d x) \tan (c+d x)}{15 d}+\frac {a^2 (7 b B+5 a C) \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {a B (a+b \cos (c+d x))^2 \sec ^4(c+d x) \tan (c+d x)}{5 d}-\frac {1}{4} \left (-9 a^2 b B-4 b^3 B-3 a^3 C-12 a b^2 C\right ) \int \sec ^3(c+d x) \, dx-\frac {1}{15} \left (-8 a^3 B-30 a b^2 B-30 a^2 b C-15 b^3 C\right ) \int \sec ^2(c+d x) \, dx\\ &=\frac {\left (9 a^2 b B+4 b^3 B+3 a^3 C+12 a b^2 C\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a \left (4 a^2 B+12 b^2 B+15 a b C\right ) \sec ^2(c+d x) \tan (c+d x)}{15 d}+\frac {a^2 (7 b B+5 a C) \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {a B (a+b \cos (c+d x))^2 \sec ^4(c+d x) \tan (c+d x)}{5 d}-\frac {1}{8} \left (-9 a^2 b B-4 b^3 B-3 a^3 C-12 a b^2 C\right ) \int \sec (c+d x) \, dx-\frac {\left (8 a^3 B+30 a b^2 B+30 a^2 b C+15 b^3 C\right ) \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{15 d}\\ &=\frac {\left (9 a^2 b B+4 b^3 B+3 a^3 C+12 a b^2 C\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {\left (8 a^3 B+30 a b^2 B+30 a^2 b C+15 b^3 C\right ) \tan (c+d x)}{15 d}+\frac {\left (9 a^2 b B+4 b^3 B+3 a^3 C+12 a b^2 C\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a \left (4 a^2 B+12 b^2 B+15 a b C\right ) \sec ^2(c+d x) \tan (c+d x)}{15 d}+\frac {a^2 (7 b B+5 a C) \sec ^3(c+d x) \tan (c+d x)}{20 d}+\frac {a B (a+b \cos (c+d x))^2 \sec ^4(c+d x) \tan (c+d x)}{5 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 3.20, size = 181, normalized size = 0.77 \[ \frac {15 \left (3 a^3 C+9 a^2 b B+12 a b^2 C+4 b^3 B\right ) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (30 a^2 (a C+3 b B) \sec ^3(c+d x)+8 \left (3 a^3 B \tan ^4(c+d x)+5 a \left (2 a^2 B+3 a b C+3 b^2 B\right ) \tan ^2(c+d x)+15 \left (a^3 B+3 a^2 b C+3 a b^2 B+b^3 C\right )\right )+15 \left (3 a^3 C+9 a^2 b B+12 a b^2 C+4 b^3 B\right ) \sec (c+d x)\right )}{120 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.53, size = 249, normalized size = 1.06 \[ \frac {15 \, {\left (3 \, C a^{3} + 9 \, B a^{2} b + 12 \, C a b^{2} + 4 \, B b^{3}\right )} \cos \left (d x + c\right )^{5} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left (3 \, C a^{3} + 9 \, B a^{2} b + 12 \, C a b^{2} + 4 \, B b^{3}\right )} \cos \left (d x + c\right )^{5} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (8 \, {\left (8 \, B a^{3} + 30 \, C a^{2} b + 30 \, B a b^{2} + 15 \, C b^{3}\right )} \cos \left (d x + c\right )^{4} + 24 \, B a^{3} + 15 \, {\left (3 \, C a^{3} + 9 \, B a^{2} b + 12 \, C a b^{2} + 4 \, B b^{3}\right )} \cos \left (d x + c\right )^{3} + 8 \, {\left (4 \, B a^{3} + 15 \, C a^{2} b + 15 \, B a b^{2}\right )} \cos \left (d x + c\right )^{2} + 30 \, {\left (C a^{3} + 3 \, B a^{2} b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{240 \, d \cos \left (d x + c\right )^{5}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.34, size = 722, normalized size = 3.06 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.44, size = 382, normalized size = 1.62 \[ \frac {C \,a^{3} \tan \left (d x +c \right ) \left (\sec ^{3}\left (d x +c \right )\right )}{4 d}+\frac {3 C \,a^{3} \sec \left (d x +c \right ) \tan \left (d x +c \right )}{8 d}+\frac {3 C \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8 d}+\frac {8 a^{3} B \tan \left (d x +c \right )}{15 d}+\frac {a^{3} B \tan \left (d x +c \right ) \left (\sec ^{4}\left (d x +c \right )\right )}{5 d}+\frac {4 a^{3} B \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{15 d}+\frac {2 C \,a^{2} b \tan \left (d x +c \right )}{d}+\frac {C \,a^{2} b \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{d}+\frac {3 a^{2} b B \tan \left (d x +c \right ) \left (\sec ^{3}\left (d x +c \right )\right )}{4 d}+\frac {9 a^{2} b B \sec \left (d x +c \right ) \tan \left (d x +c \right )}{8 d}+\frac {9 a^{2} b B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8 d}+\frac {3 C a \,b^{2} \tan \left (d x +c \right ) \sec \left (d x +c \right )}{2 d}+\frac {3 C a \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {2 B a \,b^{2} \tan \left (d x +c \right )}{d}+\frac {B a \,b^{2} \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{d}+\frac {b^{3} C \tan \left (d x +c \right )}{d}+\frac {b^{3} B \tan \left (d x +c \right ) \sec \left (d x +c \right )}{2 d}+\frac {b^{3} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.34, size = 341, normalized size = 1.44 \[ \frac {16 \, {\left (3 \, \tan \left (d x + c\right )^{5} + 10 \, \tan \left (d x + c\right )^{3} + 15 \, \tan \left (d x + c\right )\right )} B a^{3} + 240 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a^{2} b + 240 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a b^{2} - 15 \, C a^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 45 \, B a^{2} b {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 180 \, C a b^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 60 \, B b^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 240 \, C b^{3} \tan \left (d x + c\right )}{240 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.38, size = 470, normalized size = 1.99 \[ \frac {\mathrm {atanh}\left (\frac {4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,C\,a^3}{8}+\frac {9\,B\,a^2\,b}{8}+\frac {3\,C\,a\,b^2}{2}+\frac {B\,b^3}{2}\right )}{\frac {3\,C\,a^3}{2}+\frac {9\,B\,a^2\,b}{2}+6\,C\,a\,b^2+2\,B\,b^3}\right )\,\left (\frac {3\,C\,a^3}{4}+\frac {9\,B\,a^2\,b}{4}+3\,C\,a\,b^2+B\,b^3\right )}{d}-\frac {\left (2\,B\,a^3-B\,b^3-\frac {5\,C\,a^3}{4}+2\,C\,b^3+6\,B\,a\,b^2-\frac {15\,B\,a^2\,b}{4}-3\,C\,a\,b^2+6\,C\,a^2\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (2\,B\,b^3-\frac {8\,B\,a^3}{3}+\frac {C\,a^3}{2}-8\,C\,b^3-16\,B\,a\,b^2+\frac {3\,B\,a^2\,b}{2}+6\,C\,a\,b^2-16\,C\,a^2\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {116\,B\,a^3}{15}+20\,C\,a^2\,b+20\,B\,a\,b^2+12\,C\,b^3\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-\frac {8\,B\,a^3}{3}-2\,B\,b^3-\frac {C\,a^3}{2}-8\,C\,b^3-16\,B\,a\,b^2-\frac {3\,B\,a^2\,b}{2}-6\,C\,a\,b^2-16\,C\,a^2\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,B\,a^3+B\,b^3+\frac {5\,C\,a^3}{4}+2\,C\,b^3+6\,B\,a\,b^2+\frac {15\,B\,a^2\,b}{4}+3\,C\,a\,b^2+6\,C\,a^2\,b\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________